<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-2"></span><span class="hs-comment">--</span><span>
</span><span id="line-3"></span><span class="hs-comment">-- Code generation for coverage</span><span>
</span><span id="line-4"></span><span class="hs-comment">--</span><span>
</span><span id="line-5"></span><span class="hs-comment">-- (c) Galois Connections, Inc. 2006</span><span>
</span><span id="line-6"></span><span class="hs-comment">--</span><span>
</span><span id="line-7"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-8"></span><span>
</span><span id="line-9"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.StgToCmm.Hpc</span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Hpc.html#initHpc"><span class="hs-identifier">initHpc</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Hpc.html#mkTickBox"><span class="hs-identifier">mkTickBox</span></a></span><span> </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-10"></span><span>
</span><span id="line-11"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-12"></span><span>
</span><span id="line-13"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html"><span class="hs-identifier">GHC.StgToCmm.Monad</span></a></span><span>
</span><span id="line-14"></span><span>
</span><span id="line-15"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#"><span class="hs-identifier">GHC.Platform</span></a></span><span>
</span><span id="line-16"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.Graph.html"><span class="hs-identifier">GHC.Cmm.Graph</span></a></span><span>
</span><span id="line-17"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html"><span class="hs-identifier">GHC.Cmm.Expr</span></a></span><span>
</span><span id="line-18"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.CLabel.html"><span class="hs-identifier">GHC.Cmm.CLabel</span></a></span><span>
</span><span id="line-19"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Unit.Module.html"><span class="hs-identifier">GHC.Unit.Module</span></a></span><span>
</span><span id="line-20"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.Utils.html"><span class="hs-identifier">GHC.Cmm.Utils</span></a></span><span>
</span><span id="line-21"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Utils.html"><span class="hs-identifier">GHC.StgToCmm.Utils</span></a></span><span>
</span><span id="line-22"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html"><span class="hs-identifier">GHC.Driver.Types</span></a></span><span>
</span><span id="line-23"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html"><span class="hs-identifier">GHC.Driver.Session</span></a></span><span>
</span><span id="line-24"></span><span>
</span><span id="line-25"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.html#"><span class="hs-identifier">Control.Monad</span></a></span><span>
</span><span id="line-26"></span><span>
</span><span id="line-27"></span><span class="annot"><a href="GHC.StgToCmm.Hpc.html#mkTickBox"><span class="hs-identifier hs-type">mkTickBox</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#Platform"><span class="hs-identifier hs-type">Platform</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Graph.html#CmmAGraph"><span class="hs-identifier hs-type">CmmAGraph</span></a></span><span>
</span><span id="line-28"></span><span id="mkTickBox"><span class="annot"><span class="annottext">mkTickBox :: Platform -&gt; Module -&gt; Int -&gt; CmmAGraph
</span><a href="GHC.StgToCmm.Hpc.html#mkTickBox"><span class="hs-identifier hs-var hs-var">mkTickBox</span></a></span></span><span> </span><span id="local-6989586621681052340"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681052340"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span id="local-6989586621681052339"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681052339"><span class="hs-identifier hs-var">mod</span></a></span></span><span> </span><span id="local-6989586621681052338"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681052338"><span class="hs-identifier hs-var">n</span></a></span></span><span>
</span><span id="line-29"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmExpr -&gt; CmmExpr -&gt; CmmAGraph
</span><a href="GHC.Cmm.Graph.html#mkStore"><span class="hs-identifier hs-var">mkStore</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681052336"><span class="hs-identifier hs-var">tick_box</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">MachOp -&gt; [CmmExpr] -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmMachOp"><span class="hs-identifier hs-var">CmmMachOp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Width -&gt; MachOp
</span><a href="GHC.Cmm.MachOp.html#MO_Add"><span class="hs-identifier hs-var">MO_Add</span></a></span><span> </span><span class="annot"><span class="annottext">Width
</span><a href="GHC.Cmm.Type.html#W64"><span class="hs-identifier hs-var">W64</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-30"></span><span>                                </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">CmmExpr -&gt; CmmType -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmLoad"><span class="hs-identifier hs-var">CmmLoad</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681052336"><span class="hs-identifier hs-var">tick_box</span></a></span><span> </span><span class="annot"><span class="annottext">CmmType
</span><a href="GHC.Cmm.Type.html#b64"><span class="hs-identifier hs-var">b64</span></a></span><span>
</span><span id="line-31"></span><span>                                </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CmmLit -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmLit"><span class="hs-identifier hs-var">CmmLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; Width -&gt; CmmLit
</span><a href="GHC.Cmm.Expr.html#CmmInt"><span class="hs-identifier hs-var">CmmInt</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">1</span></span><span> </span><span class="annot"><span class="annottext">Width
</span><a href="GHC.Cmm.Type.html#W64"><span class="hs-identifier hs-var">W64</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-32"></span><span>                                </span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-33"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-34"></span><span>    </span><span id="local-6989586621681052336"><span class="annot"><span class="annottext">tick_box :: CmmExpr
</span><a href="#local-6989586621681052336"><span class="hs-identifier hs-var hs-var">tick_box</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; Width -&gt; CmmExpr -&gt; Int -&gt; CmmExpr
</span><a href="GHC.Cmm.Utils.html#cmmIndex"><span class="hs-identifier hs-var">cmmIndex</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681052340"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">Width
</span><a href="GHC.Cmm.Type.html#W64"><span class="hs-identifier hs-var">W64</span></a></span><span>
</span><span id="line-35"></span><span>                        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmLit -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmLit"><span class="hs-identifier hs-var">CmmLit</span></a></span><span> </span><span class="annot"><span class="annottext">(CmmLit -&gt; CmmExpr) -&gt; CmmLit -&gt; CmmExpr
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel -&gt; CmmLit
</span><a href="GHC.Cmm.Expr.html#CmmLabel"><span class="hs-identifier hs-var">CmmLabel</span></a></span><span> </span><span class="annot"><span class="annottext">(CLabel -&gt; CmmLit) -&gt; CLabel -&gt; CmmLit
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Module -&gt; CLabel
</span><a href="GHC.Cmm.CLabel.html#mkHpcTicksLabel"><span class="hs-identifier hs-var">mkHpcTicksLabel</span></a></span><span> </span><span class="annot"><span class="annottext">(Module -&gt; CLabel) -&gt; Module -&gt; CLabel
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681052339"><span class="hs-identifier hs-var">mod</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-36"></span><span>                        </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681052338"><span class="hs-identifier hs-var">n</span></a></span><span>
</span><span id="line-37"></span><span>
</span><span id="line-38"></span><span class="hs-comment">-- | Emit top-level tables for HPC and return code to initialise</span><span>
</span><span id="line-39"></span><span class="annot"><a href="GHC.StgToCmm.Hpc.html#initHpc"><span class="hs-identifier hs-type">initHpc</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HpcInfo"><span class="hs-identifier hs-type">HpcInfo</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-40"></span><span id="initHpc"><span class="annot"><span class="annottext">initHpc :: Module -&gt; HpcInfo -&gt; FCode ()
</span><a href="GHC.StgToCmm.Hpc.html#initHpc"><span class="hs-identifier hs-var hs-var">initHpc</span></a></span></span><span> </span><span class="annot"><span class="annottext">Module
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Driver.Types.html#NoHpcInfo"><span class="hs-identifier hs-type">NoHpcInfo</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-41"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">() -&gt; FCode ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-42"></span><span class="annot"><a href="GHC.StgToCmm.Hpc.html#initHpc"><span class="hs-identifier hs-var">initHpc</span></a></span><span> </span><span id="local-6989586621681052324"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681052324"><span class="hs-identifier hs-var">this_mod</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Driver.Types.html#HpcInfo"><span class="hs-identifier hs-type">HpcInfo</span></a></span><span> </span><span id="local-6989586621681052322"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681052322"><span class="hs-identifier hs-var">tickCount</span></a></span></span><span> </span><span id="local-6989586621681052321"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681052321"><span class="hs-identifier hs-var">_hashNo</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-43"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621681052320"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681052320"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-44"></span><span>       </span><span class="annot"><span class="annottext">Bool -&gt; FCode () -&gt; FCode ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GeneralFlag -&gt; DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#gopt"><span class="hs-identifier hs-var">gopt</span></a></span><span> </span><span class="annot"><span class="annottext">GeneralFlag
</span><a href="GHC.Driver.Flags.html#Opt_Hpc"><span class="hs-identifier hs-var">Opt_Hpc</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681052320"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(FCode () -&gt; FCode ()) -&gt; FCode () -&gt; FCode ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-45"></span><span>           </span><span class="annot"><span class="annottext">CLabel -&gt; [CmmLit] -&gt; FCode ()
</span><a href="GHC.StgToCmm.Utils.html#emitDataLits"><span class="hs-identifier hs-var">emitDataLits</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Module -&gt; CLabel
</span><a href="GHC.Cmm.CLabel.html#mkHpcTicksLabel"><span class="hs-identifier hs-var">mkHpcTicksLabel</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681052324"><span class="hs-identifier hs-var">this_mod</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-46"></span><span>                        </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; Width -&gt; CmmLit
</span><a href="GHC.Cmm.Expr.html#CmmInt"><span class="hs-identifier hs-var">CmmInt</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">Width
</span><a href="GHC.Cmm.Type.html#W64"><span class="hs-identifier hs-var">W64</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-47"></span><span>                        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Int -&gt; [Int] -&gt; [Int]
forall a. Int -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#take"><span class="hs-identifier hs-var">take</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681052322"><span class="hs-identifier hs-var">tickCount</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">..</span><span class="hs-special">]</span><span>
</span><span id="line-48"></span><span>                        </span><span class="hs-special">]</span><span>
</span><span id="line-49"></span><span>
</span><span id="line-50"></span></pre></body></html>